home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #1 / utv1n1s1.d64 / calendar creator (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  9KB  |  398 lines

  1. 1 rem (c)1987 uptime magazine
  2. 2 rem (c)1987 softdisk publishing, inc.
  3. 3 :
  4. 4 rem authors: john bayes
  5. 5 rem          dave hammond
  6. 6 :
  7. 9 uptime=(8*4096)+4
  8. 10 dim mnth$(12),maxday(12),days(31)
  9. 15 for a=1to12: read mnth$(a), maxday(a): next: print"[147]"
  10. 16 :
  11. 20 gosub 2000: rem *** set up screen ***
  12. 21 :
  13. 22 get k$: if (k$<>" ") and (k$<>chr$(140)) then 22
  14. 23 if k$=chr$(140) then poke 186,8: sys uptime
  15. 24 :
  16. 25 mn=0: mnth$="": gosub 2200: rem *** prompt #1 ***
  17. 26 :
  18. 30 get k$: if (k$<>"1") and (k$<>"2") then 30
  19. 35 on val(k$) gosub 2300, 2500: rem *** 1=month, 2=year ***
  20. 36 :
  21. 40 date$=mnth$+", "+t$
  22. 42 if mn=0 then date$="[212]he year "+t$
  23. 46 gosub 1800: rem *** pad the date ***
  24. 48 :
  25. 50 gosub 2600: rem *** prompt #2 ***
  26. 60 get k$: if (k$<"1") or (k$>"3") then 60
  27. 70 on val(k$) goto 100, 400, 700: rem *** 1-screen, 2-printer, 3-restart ***
  28. 95 :
  29. 96 rem ******************
  30. 97 rem  output to screen
  31. 98 rem ******************
  32. 99 :
  33. 100 year$=right$(str$(yr),4): py=yr
  34. 108 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
  35. 109 :
  36. 110 for y=bmtolm
  37. 115 mn=y: yr=py
  38. 120 gosub 1700: rem *** display calendar template ***
  39. 130 gosub 6000: rem *** calc the calendar ***
  40. 140 gosub 1600: rem *** display days of month ***
  41. 145 :
  42. 150 print"";
  43. 165 p$="[195]alendar for "+mnth$(y)+", "+year$
  44. 170 z=int((40-len(p$))/2)
  45. 175 printspc(z)"[146][159]"p$
  46. 195 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
  47. 200 get k$: if k$<>" " then 200
  48. 210 gosub 1940: next
  49. 230 goto 20: rem *** restart ***
  50. 395 :
  51. 396 rem *******************
  52. 397 rem  output to printer
  53. 398 rem *******************
  54. 399 :
  55. 400 gosub 2700: rem *** prompt for lptr ***
  56. 405 :
  57. 410 get k$: if (k$<>"1") and (k$<>"2") then 410
  58. 420 if k$="2" then goto 50
  59. 430 close 4: open4,4,7: if (st and 128) then close4: gosub 2800: goto 400
  60. 435 :
  61. 440 gosub 1400: rem *** def lptr strings ***
  62. 445 :
  63. 450 year$=right$(str$(yr),4): py=yr
  64. 460 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
  65. 465 :
  66. 466 rem ************
  67. 467 rem  print loop
  68. 468 rem ************
  69. 469 :
  70. 470 mn=bm: yr=py
  71. 475 :
  72. 480 gosub 1700: rem *** display calendar template ***
  73. 490 gosub 6000: rem *** calc the calendar ***
  74. 500 gosub 1600: rem *** screen output ***
  75. 501 :
  76. 502 print"";
  77. 504 p$="[195]alendar for "+mnth$(bm)+", "+year$
  78. 506 z=int((40-len(p$))/2)
  79. 508 printspc(z)"[146][159]"p$
  80. 509 :
  81. 510 gosub 2900: rem *** lptr output ***
  82. 515 :
  83. 560 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
  84. 570 get k$: if k$<>" " then 570
  85. 580 gosub 1940: bm=bm+1: if bm<=lm then 470: rem *** continue
  86. 590 print#4: close4: goto 20: rem *** restart ***
  87. 695 :
  88. 696 rem *****************
  89. 697 rem  incorrect entry
  90. 698 rem *****************
  91. 699 :
  92. 700 gosub 1900
  93. 710 print"";
  94. 720 gosub 2120
  95. 730 goto 22
  96. 995 :
  97. 996 rem ***************
  98. 997 rem  calendar data
  99. 998 rem ***************
  100. 999 :
  101. 1000 data "[202]anuary",31,"[198]ebruary",29,"[205]arch",31
  102. 1010 data "[193]pril",30,"[205]ay",31,"[202]une",30,"[202]uly",31
  103. 1020 data "[193]ugust",31,"[211]eptember",30,"[207]ctober",31
  104. 1030 data "[206]ovember",30,"[196]ecember",31
  105. 1395 :
  106. 1396 rem ************************
  107. 1397 rem  define printer strings
  108. 1398 rem ************************
  109. 1399 :
  110. 1400 p1$="[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178]"
  111. 1402 p2$="[192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
  112. 1404 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
  113. 1406 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
  114. 1408 p5$="[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177]"
  115. 1410 p6$="[192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]"
  116. 1412 p7$="[221]         [221]         [221]         [221]"
  117. 1414 p8$="         [221]         [221]         [221]         [221]"
  118. 1420 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
  119. 1430 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
  120. 1440 return
  121. 1595 :
  122. 1596 rem **********************
  123. 1597 rem  print days to screen
  124. 1598 rem **********************
  125. 1599 :
  126. 1600 f=0: print"";
  127. 1605 for x=1toeom
  128. 1610 if (day(1)=0) then goto 1650
  129. 1611 :
  130. 1615 if f=1 then 1650
  131. 1620 f=1: b=day(1)
  132. 1630 for x1=1tob: print"  ";
  133. 1640 next
  134. 1645 :
  135. 1650 x$=str$(x): if len(x$)>2 then x$=right$(x$,2)
  136. 1660 print"";x$;"";
  137. 1670 if peek(211)=38 then print:print"";
  138. 1675 if peek(214)=18 then print"[145][145]";
  139. 1680 next
  140. 1690 return
  141. 1695 :
  142. 1696 rem ******************
  143. 1697 rem  display calendar
  144. 1698 rem ******************
  145. 1699 :
  146. 1700 print"";tl$
  147. 1710 print"  [221][211]un.[221][205]on.[221][212]ue.[221][215]ed.[221][212]hr.[221][198]ri.[221][211]at.[221]"
  148. 1720 print"  ";m2$
  149. 1730 for x=1to14
  150. 1740 p$=m1$: if (x/3)=int(x/3) then p$=m2$
  151. 1750 print"  ";p$
  152. 1760 next
  153. 1770 print"  "bl$
  154. 1780 return
  155. 1795 :
  156. 1796 rem **************
  157. 1797 rem  pad the date
  158. 1798 rem **************
  159. 1799 :
  160. 1800 pad=int((18-len(date$))/2)
  161. 1810 for x=1topad
  162. 1820 date$=" "+date$
  163. 1830 next
  164. 1840 date$=left$(date$+"        ",18)
  165. 1850 return
  166. 1895 :
  167. 1896 rem *****************
  168. 1897 rem  clear text area
  169. 1898 rem *****************
  170. 1899 :
  171. 1900 print"";
  172. 1910 printspc(11)"[158]                  "
  173. 1920 print"";
  174. 1930 for x=1to4: printspc(11)"[158]                  ": next
  175. 1940 print"";
  176. 1950 for x=1to6: print"                                       ";
  177. 1953 if x<6 then print
  178. 1955 next
  179. 1960 print"";
  180. 1970 return
  181. 1995 :
  182. 1996 rem ***************
  183. 1997 rem  set up screen
  184. 1998 rem ***************
  185. 1999 :
  186. 2000 poke 53280,0: poke 53281,0
  187. 2010 printchr$(8)chr$(14)
  188. 2020 tl$="[176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]"
  189. 2030 bl$="[173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
  190. 2040 m1$="[221]    [221]    [221]    [221]    [221]    [221]    [221]    [221]"
  191. 2050 m2$="[171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
  192. 2060 gosub 1700: rem *** display calendar ***
  193. 2120 printspc(4)"[159][208]ress the [211]pace [194]ar[159] to continue"
  194. 2125 printspc(7)"[159][208]ress [198]8[159] to exit to [213]p[212]ime"
  195. 2130 printspc(3)"[158](c)1987 [211]oftdisk [208]ublishing, [201]nc."
  196. 2140 printspc(9)"[151]                    "
  197. 2142 printspc(9)"[151] [158][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  198. 2144 printspc(9)"[151] [158][221] [195]alendar [195]reator [221]"
  199. 2146 printspc(9)"[151] [158][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
  200. 2148 printspc(9)"[151] [158][221] by               [221]"
  201. 2150 printspc(9)"[151] [158][221]    [202]ohn [194]ayes    [221]"
  202. 2152 printspc(9)"[151] [158][221]       and        [221]"
  203. 2154 printspc(9)"[151] [158][221]   [196]ave [200]ammond   [221]"
  204. 2156 printspc(10)"[158][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  205. 2190 return
  206. 2195 :
  207. 2196 rem ***********
  208. 2197 rem  prompt #1
  209. 2198